/**
  ******************************************************************************
  * @file    User/LL/include.h
  * @author  TOPSYS Application Team
  * @version V1.0.0
  * @date    02-11-2018
  * @brief   A generic header file containing various required header files
  ******************************************************************************
  * @attention
  *
  * <h2><center>&copy; COPYRIGHT 2018 TOPSYS</center></h2>
  *
  *
  *
  ******************************************************************************
  */ 

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __INCLUDE_H__
#define __INCLUDE_H__

#ifdef __cplusplus
 extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "ts32fx.h"
#include "core_cm0.h"
#include "ts32fx_system.h"
#include "ts32fx_ll_module.h"

//#include "core_cmFunc.h"
//#include "core_cmSimd.h"
// math
#include <math.h>

// lib
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
	 
	// #define USE_PIN24_CHIP 0
	 #ifdef USE_PIN24_CHIP
	 #define DB 3
	 #define CB 8
	 #define SB 9
	 #else
	 #define DB 3
	 #define CB 4
	 #define SB 5
	 #endif
	 
	 
#define GRID4_SEG13 0x00    /* 4?13? */
#define GRID5_SEG12 0x01    /* 5?12? */
#define GRID6_SEG11 0x02    /* 6?11? */
#define GRID7_SEG10 0x03    /* 7?10? */

#define USE_GRID 0x03


#if (GRID4_SEG13 == USE_GRID)
#define NBYTES 8
#elif (GRID5_SEG12 == USE_GRID)
#define NBYTES 10
#elif (GRID6_SEG11 == USE_GRID)
#define NBYTES 12
#else
#define NBYTES 14
#endif

//g 1<0
//c 1<<1
//dot 1<<2
//d 1<<3
//e 1<<4
//a 1<<5
//6  7  8 
//f 1<<9 
//b 1<<11
//g 1<<15
#define SEGA (1<<5) //0k
#define SEGB (1<<11)
#define SEGC (1<<1)
#define SEGD (1<<3)
#define SEGE (1<<4)
#define SEGF (1<<9)
#define SEGG (1<<0)
#define SEGH (1<<2)

#define SEGI (1<<8)
#define SEGJ (1<<9)
#define SEGK (1<<10)
#define SEGL (1<<11)
#define SEGM (1<<12)



	 


/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

#ifdef __cplusplus
}
#endif

#endif //__INCLUDE_H__

/*************************** (C) COPYRIGHT 2018 TOPSYS ***** END OF FILE *****/
